<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labor_companies', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('admin_id')->default(0)->index();
            $table->unsignedBigInteger('company_id')->default(0)->index();
            $table->unsignedBigInteger('role_id')->default(0)->index();
            $table->string('name')->nullable()->comment('劳务公司名称');
            $table->string('number')->nullable()->comment('劳务公司编号');
            $table->string('bank')->nullable()->comment('开户银行');
            $table->string('bank_number')->nullable()->comment('银行账号');
            $table->string('contacts')->nullable()->comment('联系人');
            $table->string('contact_mobile')->nullable()->comment('联系人电话');
            $table->string('company_type')->nullable()->comment('公司类型');
            $table->string('brief')->nullable()->comment('介绍');
            $table->string('remarks')->nullable()->comment('备注');
            $table->string('business_cert')->nullable()->comment('营业执照');
            $table->string('security_cert')->nullable()->comment('安全许可');
            $table->string('legal_cert')->nullable()->comment('法人A证');
            $table->string('safety_cert')->nullable()->comment('安全员C证');
            $table->string('human_resources_cert')->nullable()->comment('人力资源派遣资格证');
            $table->string('files')->nullable()->comment('附件上传');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labor_companies');
    }
};
